﻿using System;
using Game;

namespace Mekiasm
{
    public class ListViewWidget : CanvasWidget
    {
        public Func<object, Widget> Adapter
        {
            set { if (value != null) ListPanelWidget.ItemWidgetFactory = value; }
        }
        public Action<object> ItemClicked
        {
            set { if (value != null) ListPanelWidget.ItemClicked += value; }
        }
        public ListPanelWidget ListPanelWidget = new ListPanelWidget();

        public LayoutDirection Direction
        {
            get { return ListPanelWidget.Direction; }
            set { ListPanelWidget.Direction = value; }
        }
        public ListViewWidget()
        {
            Children.Add(ListPanelWidget);
        }
        public void AddItem(object obj)
        {
            ListPanelWidget.AddItem(obj);
        }
        public void Clear()
        {
            ListPanelWidget.ClearItems();
        }
    }
}
